<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>websocket聊天室客户端</title>
    <style>
        .content{
            width: 400px;
            height:500px;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <!-- 消息输入框 -->
    <input type="text" placeholder="请输入您的内容">
    <!-- 发送按钮 -->
    <button>发送消息</button>
    <!-- 显示结果 -->
    <div class="content">
    </div>
    
</body>
<script src="/socket.io/socket.io.js"></script>
<script>
    // 连接socket服务
    var socket = io("http://localhost:3001");
    socket.emit("clientMsg",{name:'zhangsan',age:77})


</script>
</html>